#include <stdio.h>
#include <stdlib.h>

struct node {
    int data;
    struct node *next;
};

void insert(struct node *head, int value) {
    struct node *new_node = (struct node*)malloc(sizeof(struct node));
    new_node->data = value;
    new_node->next = NULL;

    struct node *current = head;
    while (current->next != NULL) {
        current = current->next;
    }
    current->next = new_node;
}

void release(struct node *head) {
    struct node *current = head->next;
    while (current != NULL) {
        struct node *temp = current;
        current = current->next;
        free(temp);
    }
}

void sortAndPrint(struct node *head) {
    struct node *p, *q;
    int temp;
    for (p = head->next; p != NULL; p = p->next) {
        for (q = p->next; q != NULL; q = q->next) {
            if (p->data > q->data) {
                temp = p->data;
                p->data = q->data;
                q->data = temp;
            }
        }
        printf("%d ", p->data);
    }
}

int main() {
    int n;
    scanf("%d", &n);
    struct node *head = (struct node*)malloc(sizeof(struct node));
    head->next = NULL;

    for (int i = 0; i < n; i++) {
        int value;
        scanf("%d", &value);
        insert(head, value);
    }

    sortAndPrint(head);
    release(head);

    return 0;
}

